﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace modelbuilder {
using data.contracts;
using data.contracts.messages;
using ebcpatterns.flow;
using modelbuilder.parts;
using System.Xml.Linq;
public interface IXmlFileAdapter {
  event Action<IEnumerable<XDocument>> Out_Result;
  void In_Process(IEnumerable<string> message);
}
public interface IBoardBuilder {
  event Action<IEnumerable<Board>> Out_Result;
  void In_Process(Tuple<IEnumerable<XDocument>,string> message);
}
public interface IExpandSplitWires {
  event Action<IEnumerable<Board>> Out_Result;
  void In_Process(IEnumerable<Board> message);
}
public interface IExpandJoinWires {
  event Action<IEnumerable<Board>> Out_Result;
  void In_Process(IEnumerable<Board> message);
}
public interface IParse_pins {
  event Action<IEnumerable<Board>> Result;
  void Process(IEnumerable<Board> message);
}
public interface IModelBuilder {
  event Action<IEnumerable<Board>> Result;
  void Process(BuildBoardsMessage message);
}
public partial class ModelBuilder : IModelBuilder {
  public event Action<IEnumerable<Board>> Result;

  private Action<BuildBoardsMessage> _Process;
  public void Process(BuildBoardsMessage message) {
    _Process(message);
  }
  public ModelBuilder(IXmlFileAdapter xmlFileAdapter, IJoin<IEnumerable<XDocument>,string,Tuple<IEnumerable<XDocument>,string>> join, IBoardBuilder boardBuilder, IExpandSplitWires ExpandSplitWires, IExpandJoinWires ExpandJoinWires, IParse_pins Parse_pins) {
  var __split1 = new Split<BuildBoardsMessage,IEnumerable<string>,string>();    this._Process += __split1.Input;
    __split1.Output1 += xmlFileAdapter.In_Process;
    __split1.Output2 += join.Input2;
    xmlFileAdapter.Out_Result += join.Input1;
    join.Output += boardBuilder.In_Process;
    boardBuilder.Out_Result += ExpandSplitWires.In_Process;
    ExpandSplitWires.Out_Result += ExpandJoinWires.In_Process;
    ExpandJoinWires.Out_Result += Parse_pins.Process;
    Parse_pins.Result += m => this.Result(m);
  }
}

}
